﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace VAdvantage.Controls
{
    public class VToolBar:WrapPanel
    {

        public VToolBar()
        {
            this.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            this.Orientation = System.Windows.Controls.Orientation.Horizontal;


            //this.Background = new SolidColorBrush(Colors.Gray);
        }

        public UIElementCollection ToolBarItems
        {

            get
            {
               return  this.Children;
                
            }
        }


        static void IsReadOnlyChanged(object sender, DependencyPropertyChangedEventArgs args)
        {
            //VToolBar obj = sender as VToolBar;

            //bool isReadOnly = (bool)args.NewValue;
            //foreach (var c in obj.Children)
            //{
            //    if (c is ToolBarButton)
            //    {
            //        ((ToolBarButton)c).IsEnabled = !isReadOnly;
            //    }
            //}
        }


        public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
        "IsReadOnly",
        typeof(bool),
        typeof(VToolBar),
        new PropertyMetadata(IsReadOnlyChanged));
        public bool IsReadOnly
        {
            set
            {
                //this.SetValue(IsReadOnlyProperty, value);
            }

            get
            { 
                return false;
                //return (bool)this.GetValue(IsReadOnlyProperty);
            }
        }



    }
}
